#include<cstdio>
#include<cstring>
using namespace std;

struct Map {
    int arr[3], step;

    Map() {
        memset(arr, 0, sizeof(arr));
        step = 0;
    }
} start, full, li[100000];
int front = 0, rear = -1;

int main() {
    int a, b, c, k;
    bool flag;

    while(scanf("%d%d%d%d", &a, &b, &c, &k) != EOF) {
        front = 0, rear = -1;
        full.arr[0] = start.arr[0] = a;
        full.arr[1] = b;
        full.arr[2] = c;
        flag = false;
        bool v[100][100][100] = {false};

        li[++rear] = start;
        if (k == a) {
            printf("yes\n0\n");
            flag = true;
        }

        while(front <= rear) {
            if(flag)    break;
            // 第i个容器向第j个容器倾倒油
            for (int i=0; i<3; i++) {
                for (int j=0; j<3; j++) {
                    Map now = li[front];
                    if (i == j || 0 == now.arr[i] ||  full.arr[j] == now.arr[j]) continue;
                    int temp = now.arr[i] - (full.arr[j] - now.arr[j]);
                    if (temp > 0) {
                        // j被倒满了
                        now.arr[j] = full.arr[j];
                        now.arr[i] = temp;
                    } else {
                        // i被倒光了
                        now.arr[j] += now.arr[i];
                        now.arr[i] = 0;
                    }
                    now.step++;
                    if(v[now.arr[0]][now.arr[1]][now.arr[2]])   continue;
                    if(k == now.arr[0] || k == now.arr[1] || k == now.arr[2]) {
                        printf("yes\n%d\n", now.step);
                        flag = true;
                    }
                    v[now.arr[0]][now.arr[1]][now.arr[2]] = true;
                    li[++rear] = now;
                }
            }
            front++;
        }
        if(!flag)
            printf("no\n");
    }
    
    return 0;
}